package com.teacher.collections;

import java.util.*;


public class CollectionsOperation {
    public static void main(String[] args) {
        int ss[]={1,8,4,33,0,6};

        Set s = new HashSet();
        Set bb=new HashSet();
        for (int i = 0; i <ss.length ; i++) {
            bb.add(ss[i]);

        }
        System.out.println(bb);
       Iterator iterator1=bb.iterator();
       while (iterator1.hasNext()){
           System.out.println(iterator1.next());
       }
    }



    /**
     * <p>快捷构造一个List</p>
     *
     * @param ts 可变参数 任意数量的参数
     * @return List
     */
    public static <T> List getList(T... ts) {
        //前置检查
        ArrayList<T> res = new ArrayList<T>();
        if (ts == null) {
            return res;
        }
        for (T t : ts) {
            res.add(t);
        }
        return res;
    }

}
